<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        1. 说明 a = b = c = d = 1;的执行过程
        2. for(var i = 0,j = 0; i < 5, j < 10; i++,j++){} 请问当前for循环的循环次数??为什么
        3. 代码题:请得到7天以后的现在的时间
        4. 代码题:'abaabgfdebbafefgfsrsbabesseeeeaa' 请计算每一个字母出现的次数,及出现最多次数的字母
      */

      // 1. 过程是 d = 1 , c = d, b = c, a = b

      // 2.
      for (var i = 0, j = 0; i < 5, j < 10; i++, j++) {
        console.log(i, j);
      }
      // 循环判断会以，后面的作为继续判断的 也就是J满足条件就会继续循环 前面I的判断条件失效

      // 3.代码题:请得到7天以后的现在的时间
      var date = new Date();
      var Year = date.getFullYear();
      var Month = date.getMonth() + 1;
      var dt = date.getDate() + 7;
      var time = date.toLocaleTimeString();
      console.log(Year + "年" + Month + "月" + dt + "日" + time);

      // 4.代码题
      var str = "abaabgfdebbafefgfsrsbabesseeeeaa";
      var str1 = str.split("");
      var str2 = [...new Set(str1)];

      for (let i = 0; i < str2.length; i++) {
        var n = 0;
        for (let j = 0; j < str.length; j++) {
          if (str2[i] === str[j]) {
            var index = str2[i] + "=" + ++n;
          }
        }
        console.log(index);
      }
    </script>
  </body>
</html>
